exports.update_bulk_purchase_activity_shareCount = function (req, res) {

    var restfulParams = req.routeInfo.restfulParams;
    
    var shareCount = 0;

    //任务流创建
    async.waterfall([
            //1.查询用户是否已对当前文章/问题点赞
            function (cb) {
                R.SEND_HTTP(
                    req,
                    {
                        url: CORE_APIConfig.coreAPI.searchOrganizationActivity + "/oa_id/" + restfulParams.oa_id,
                        method: 'POST',
                        data: {
                            fields: ["oa_share_count"].join(",")
                        }
                    },
                    function (err, data) {
                     
                        //判断是否有错误信息
                        if (err) {
                            return cb(err, data);
                        }

                        //console.log(data);

                        shareCount = data.data[0].oa_share_count;
                        cb();
                    }
                );

            },
            //更新分享记录
            function (cb) {
                
                        R.SEND_HTTP(
                            req,
                            {
                                url: CORE_APIConfig.coreAPI.updateOrganizationActivity,
                                method: 'POST',
                                data: {
                                    oa_id : restfulParams.oa_id,
                                    oa_share_count : parseInt(shareCount) + 1
                                }
                            },
                            function (err, data) {

                                //console.log(data);
                                cb();
                            }
                        );
                    
            }
        ], function (err, result) {

            //返回最终拼接结果
            RES.response(res, true);

        }
    );

}